package com.xhs.main.service.cwb.impl;

import com.xhs.main.dao.cwb.CwbQuarterSpendingDao;
import com.xhs.main.dao.cwb.CwbQuarterlyRevenueDao;
import com.xhs.main.entity.cwb.CwbQuarterSpending;
import com.xhs.main.entity.cwb.CwbQuarterlyRevenue;
import com.xhs.main.service.cwb.CwbQuarterSpendingService;
import com.xhs.main.service.cwb.CwbQuarterlyRevenueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * create by ljw on 2020/10/16
 *
 */

@Service
public class CwbQuarterSpendingServiceImpl implements CwbQuarterSpendingService {

    @Autowired
    CwbQuarterSpendingDao cwbQuarterSpendingDao;


    @Override
    public void addCwbQuarterSpending(CwbQuarterSpending cwbQuarterSpending) {
        cwbQuarterSpendingDao.insertCwbQuarterSpending(cwbQuarterSpending);
    }

    @Override
    public List<CwbQuarterSpending> getAllCwbQuarterSpending() {
        List<CwbQuarterSpending> cwbQuarterSpendings = cwbQuarterSpendingDao.selectAllCwbQuarterSpending();
        return cwbQuarterSpendings;
    }

    @Override
    public CwbQuarterSpending getOneByID(Integer cwbQSId) {
        CwbQuarterSpending cwbQuarterSpending = cwbQuarterSpendingDao.selectOneByID(cwbQSId);
        return cwbQuarterSpending;
    }

    @Override
    public Double getAllMoney() {
        Double money = cwbQuarterSpendingDao.selectAllMoney();
        return money;
    }
}
